﻿#region Includes

using System;
using System.Collections.Generic;
using System.Windows.Forms;

#endregion

namespace ArtheaEditor
{
    public partial class CollectionEditor : UserControl
    {
        public CollectionEditor()
        {
            InitializeComponent();
            Dock = DockStyle.Fill;
        }

        private void lstCollection_SelectedIndexChanged(object sender, EventArgs e)
        {
        }

        public void SetCollection<T>(IEnumerable<T> items) where T : class
        {
            lstCollection.DataSource = items;
        }

        public void SetEditor(Control ctl)
        {
            splitContainer1.Panel2.Controls.Clear();
            splitContainer1.Panel2.Controls.Add(ctl);
        }

        public object SelectedItem
        {
            get { return lstCollection.SelectedItem; }
        }
    }
}